package cn.lingyangwl.agile.system.config;

import cn.lingyangwl.agile.model.constants.CommonCons;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author shenguangyang
 */
@Data
@ConfigurationProperties(prefix = CommonCons.PROPERTIES_PREFIX + "tenant")
public class TenantProperties {
    /**
     * 一级域名
     */
    private String domain = "http://127.0.0.1:3100";


    /**
     * 域名前缀
     * arg1: 租户id
     */
    private String urlPre = "/site/s%s";

    /**
     * 获取可访问地址
     * @param tenantId 租户域名
     */
    public String getUrl(String tenantId) {
        return domain + String.format(urlPre, tenantId);
    }
}
